package flc.ast.fragment;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import flc.ast.R;
import flc.ast.activity.SelAudioActivity;
import flc.ast.activity.SelVideoActivity;
import flc.ast.databinding.FragmentAudioEditBinding;
import stark.common.basic.base.BaseNoModelFragment;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link AudioEditFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class AudioEditFragment extends BaseNoModelFragment<FragmentAudioEditBinding> {


    @Override
    protected int onCreate() {
        return R.layout.fragment_audio_edit;
    }

    @Override
    protected void initView() {
        mDataBinding.ivVoiceChange.setOnClickListener(this);
        mDataBinding.ivAudioPitchSpeed.setOnClickListener(this);
        mDataBinding.tvAudioFormat.setOnClickListener(this);
        mDataBinding.tvAudioSplice.setOnClickListener(this);
        mDataBinding.tvAudioCut.setOnClickListener(this);
        mDataBinding.tvExtractAudio.setOnClickListener(this);
        mDataBinding.tvCompressAudio.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        int id = v.getId();
        if (id == R.id.ivVoiceChange) {//变声器
            SelAudioActivity.type = 0;
            startActivity(SelAudioActivity.class);
        } else if (id == R.id.ivAudioPitchSpeed) {//变调变速
            SelAudioActivity.type = 1;
            startActivity(SelAudioActivity.class);
        } else if (id == R.id.tvAudioFormat) {//格式转换
            SelAudioActivity.type = 2;
            startActivity(SelAudioActivity.class);
        } else if (id == R.id.tvAudioSplice) {//音频拼接
            SelAudioActivity.type = 3;
            startActivity(SelAudioActivity.class);
        }else if (id == R.id.tvAudioCut) {//音频裁剪
            SelAudioActivity.type = 4;
            startActivity(SelAudioActivity.class);
        } else if (id == R.id.tvExtractAudio) {//提取音频
            startActivity(SelVideoActivity.class);
        } else if (id == R.id.tvCompressAudio) {//压缩音频
            SelAudioActivity.type = 5;
            startActivity(SelAudioActivity.class);
        }
    }

    @Override
    protected void initData() {

    }
}